package com.example.bookmanagersystem.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;

// 独立的密码加密配置类，避免与SecurityConfig耦合
@Configuration
public class PasswordConfig {

    // 定义PasswordEncoder Bean，供全项目使用
    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}